/*


*/
class AriTest{
	public static void main(String[] args){
		// 除号 /
		int num1 = 12;
		int num2 = 2;
		int result1 = num1 / num2;
		System.out.println(result1);

		int result2 = num1 / num2 * num2;
		System.out.println(result1);

		double result3 = num1 / num2;
		System.out.println(result3);

		double result4 = num1 / num2 + 0.0;
		double result5 = num1 / (num2 + 0.0);
		double result6 = (double)num1 / num2;
		double result7 = (double)(num1 / num2);

		System.out.println(result4);
		System.out.println(result5);
		System.out.println(result6);
		System.out.println(result7);


		// % 取余运算
		// 结果的符号和被模数符号有关

		int m1 = 12;
		int n1 = 5;
		System.out.println(m1%n1);

		int m2 = -12;
		int n2 = 5;
		System.out.println(m2%n2);

		int m3 = 12;
		int n3 = -5;
		System.out.println(m3%n3);

		int m4 = -12;
		int n4 = -5;
		System.out.println(m4%n4);


		// a++ 先自增1，后运算，返回自增前的值
		// ++a 先运算，后自增1，返回自增后的值

		int a1 = 10;
		int b1 = ++a1;
		System.out.println("a1 = " + a1 + " b1 = " + b1);

		int a2 = 10;
		int b2 = a2++;
		System.out.println("a2 = " + a2 + " b2 = " + b2);

		int a3 = 10;
		++a3;
		int b3 = a3;


		// 注意！
		short s1 = 10;
		// s1 = s1 + 1; // 编译失败
		// s1 = (short)(s1 + 1);
		s1++;
		System.out.println(s1);


		// 小知识
		byte by1 = 127;
		by1++;
		System.out.println("by1 = " + by1);

		// a-- 先自减1，后运算，返回自减前的值
		// --a 先运算，后自减1，返回自减后的值
		int a4 = 10;
		int b4 = a4--;
		System.out.println("a4 = " + a4 + " b4 = " + b4);

		int i1 = 0;
		System.out.println("i1++ = " + i1++ + " ++i1 = " + ++i1);

	}
}